package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Parameter;
import com.wiscamp.ninechapters.panels.infrastructure.po.ParameterPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.ParameterView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ParameterConverter {
    ParameterConverter Instance = Mappers.getMapper(ParameterConverter.class);

    Parameter toParameter(ParameterPO po);

    Parameter toParameterByView(ParameterView view);

    ParameterPO toParameterPO(Parameter entity);

    ParameterPO toParameterPO(Parameter entity, @MappingTarget ParameterPO po);

}
